# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=encpipe
pkgver=0.5
pkgrel=2
pkgdesc='Encrypt data from stdin to stdout with libhydrogen'
url='https://github.com/jedisct1/encpipe'
arch=('loong64' 'x86_64')
license=('ISC')
makedepends=('git')
source=("git+https://github.com/jedisct1/${pkgname}.git#tag=${pkgver}"
        # this patch was commited upstream as f278117be2e5ee563813df83e1f22fd567461d4e
        "ldflags.patch")
b2sums=('SKIP'
        '7f874694b9af75592f44cc037a032099e56b2d83459da95ae02e6bc6d76b4e3a7fc3d39fa302141a2666cb1d6a7eb7ce5f2ed0d8bd2dc7885801d73f3b02b8ed')

prepare() {
  cd ${pkgname}
  patch -p1 -i ../ldflags.patch
}

build() {
  cd ${pkgname}
  make bin
}

check() {
  cd ${pkgname}
  make test
}

package() {
  cd ${pkgname}
  install -Dm 755 encpipe -t "${pkgdir}/usr/bin"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
